var niceScrobj = null, dealflag = "home";
var winWidth = 0, winHeight = 0, minwidth = 480;
//显示菜单
function showMenu() {
	init();
	dealflag = "menu";
	$("#menu").css("display", "");
	$("#header").css("margin-left", winWidth * 0.9 + "px");
}
//显示消息
function showMsg() {
	dealflag = "msg";
	$("#message").css("display", "");
	$("#message").css("margin-left", winWidth * 0.1 + "px");
	$("#header").css("margin-left", -winWidth * 0.9 + "px");
}
//显示主页内容
function returnHome() {
	dealflag = "home";
	$("#menu").css("display", "none");
	$("#message").css("display", "none");
	$("#header").css("margin-left", "0px");
}
//获取页面宽高
function init() {
	winWidth = document.body.clientWidth;
	winHeight = document.body.clientHeight;
	if (winWidth <= minwidth) {
		winWidth = minwidth;
	}
}
//重设页面宽度，菜单与消息，以页面宽度的90%显示，展示时将有10%页面显示主页内容
function resize() {
	init();
	$("#menu").css("width", winWidth * 0.9 + "px");
	$("#message").css("width", winWidth * 0.9 + "px");
	$("#header").css("width", winWidth + "px");
	$("#bodyobj").css("width", winWidth + "px");
	$("#home1").css("height", (winHeight - 80) + "px");
	$("#home1").getNiceScroll().resize();
	if (dealflag == "menu")
		showMenu();
	if (dealflag == "msg")
		showMsg();
}
$(document).ready(function(e) {
    var headerTds=$(".header table td");
	$.each(headerTds,function(i,items){
		if(i%2==0){
			$(items).attr("width","20%");
		}
	});
});
